package packge.io;

import java.io.*;

class IOTest6 {
	public static void main(String st[]) throws Exception {
		FileInputStream fis = null;
		FileOutputStream fos = null;
		BufferedReader br = null;
		String sourceFile = "";
		try {
			InputStreamReader isr = new InputStreamReader(System.in);
			br = new BufferedReader(isr);
			System.out.println("Provide Souce File");
			sourceFile = br.readLine();
			fis = new FileInputStream(sourceFile);
			System.out.println("Provide destination File");
			String dFile = br.readLine();
			fos = new FileOutputStream(dFile);
			while (true) {
				int x = fis.read();
				if (x == -1)
					break;
				fos.write(x);
			}
		} catch (FileNotFoundException e) {
			System.out.println("source file" + sourceFile + "is not available");
		} finally {
			// close conn
		}
		System.out.println("writing completed");
	}
}